//
//  AppController.h
//  ChipmunkEditor
//
//  Created by Rewolf Us on 11-2-3.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
@class TestbedLayer;
@class DrawLayer;
@class CmCircle;

@interface AppController : NSObject {
	IBOutlet NSMutableArray *objects;
	IBOutlet NSArrayController *objectsController;
	
	IBOutlet NSTableView *objectsTable;
	
	//windows
	IBOutlet NSWindow *mainWindow;
	//circle
	IBOutlet NSWindow *addCircleSheet;
	IBOutlet NSTextField *circle_x;
	IBOutlet NSTextField *circle_y;
	IBOutlet NSTextField *circle_r;
	IBOutlet NSTextField *circle_m;
	IBOutlet NSTextField *circle_name;
	
	IBOutlet NSWindow *addPloygonSheet;
	IBOutlet NSWindow *addBoxSheet;
	
	TestbedLayer *testbedLayerDelegate;
	DrawLayer *drawLayerDelegate;
}

@property (retain,readwrite) NSMutableArray *objects;
@property (retain) TestbedLayer *testbedLayerDelegate;
@property (retain) DrawLayer *drawLayerDelegate;

+(AppController*)sharedAppcontroller;
//Sheets
-(IBAction)showAddCircleSheet:(id)sender;
-(void)addCircleWithX:(float)aX Y:(float)aY radius:(float)radius;
-(IBAction)endAddCircleSheet:(id)sender;

//toolbar
-(IBAction)startEngine:(id)sender;
-(IBAction)stopEngine:(id)sender;
-(IBAction)resetEngine:(id)sender;
-(IBAction)debugModeToggle:(id)sender;

//draw
-(IBAction)startDrawACircle:(id)sender;

//add
-(CmCircle *)createCirle:(NSString *)aName 
					   X:(float)aX 
					   Y:(float)aY
					Mass:(float)aMass 
				  Radius:(float)aRadius;

@end
